SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Vote]') AND type in (N'U'))
BEGIN
    DROP TABLE [dbo].[Vote]
END

CREATE TABLE [dbo].[Vote](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[VoteValue] [int] NOT NULL,
	[VoteIP] [varchar](50) NULL,
	[VoteTime] [datetime] NULL,
 CONSTRAINT [PK_Vote] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Rank]') AND type in (N'U'))
BEGIN
	DROP TABLE [dbo].[Rank]
END

CREATE TABLE [dbo].[Rank](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Score] [smallint] NOT NULL,
	[UpTime] [datetime] NOT NULL,
	[Address] [varchar](100) NULL,
	[IP] [varchar](50) NULL,
 CONSTRAINT [PK_Rank] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[UserMsg]') AND type in (N'U'))
BEGIN
	DROP TABLE [dbo].[UserMsg]
END

CREATE TABLE [dbo].[UserMsg](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](50) NULL,
	[Message] [varchar](1000) NULL,
	[IP] [varchar](50) NULL,
	[AssTime] [datetime] NULL,
 CONSTRAINT [PK_UserMsg] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

